# generate the Input class header and cpp files for the lattice_ed program
add_custom_command( OUTPUT ${FORMIC_BINARY_DIR}/src/formic/lattice_ed/input.h
                           ${FORMIC_BINARY_DIR}/src/formic/lattice_ed/input.cpp
                    COMMAND input_options_generator
                            ${FORMIC_SOURCE_DIR}/src/formic/lattice_ed/input_options.txt
                            ${FORMIC_BINARY_DIR}/src/formic/lattice_ed/input.h
                            ${FORMIC_BINARY_DIR}/src/formic/lattice_ed/input.cpp
                            formic/lattice_ed/input.h
                            led
                    WORKING_DIRECTORY ${FORMIC_BINARY_DIR}/src/formic/lattice_ed
                    DEPENDS ${FORMIC_SOURCE_DIR}/src/formic/lattice_ed/input_options.txt
                            input_options_generator
                    COMMENT "generating formic/lattice_ed/input.h and formic/lattice_ed/input.cpp"
                  )

add_library(formic_lattice_ed lattice_ed.cpp
                              indexing.cpp
                              configuration.cpp
                              ham_actor_heis.cpp
                              ham_actor_hubb.cpp
                              ${FORMIC_BINARY_DIR}/src/formic/lattice_ed/input.cpp
           )
target_link_libraries(formic_lattice_ed formic_lapack
                                        formic_numeric
                                        formic_random
                                        formic_input_base
                                        formic_output
                                        formic_timing
                                        formic_wfn
                                        ${CMAKE_THREAD_LIBS_INIT}
                     )

add_executable(lattice_ed main.cpp)
target_link_libraries(lattice_ed formic_lattice_ed)

add_subdirectory(test0)
add_subdirectory(test1)
add_subdirectory(test2)
add_subdirectory(test3)

install(
        TARGETS
          lattice_ed
          formic_lattice_ed
        RUNTIME DESTINATION
          bin
        LIBRARY DESTINATION
          lib
        ARCHIVE DESTINATION
          lib
       )
